from lxml import etree
tree = etree.parse('xpath_base.html')
# li_list = tree.xpath('//body/ul/li[@id]/text()')
# li_list = tree.xpath('//body/ul/li[@id="l1"]/text()')
# li_list = tree.xpath('//body/ul/li[@id="l1"]/@class')
# li_list = tree.xpath('//body/ul/li[@class="c1"]')
# li_list = tree.xpath('//body/ul/li[contains(@id,"l")]/text()')
# li_list = tree.xpath('//body/ul/li[starts-with(@id,"l")]/text()')
# li_list = tree.xpath('//body/ul/li[@id="l1" and @class="c1"]/text()')
li_list = tree.xpath('//body/ul/li[@id="l1"]/text() | //body/ul/li[@class="c2"]/text()')
print(li_list)